//package com.song.mvc;
//
//import com.song.mvc.config.MvcAppConfig;
//import org.springframework.web.WebApplicationInitializer;
//import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
//import org.springframework.web.servlet.DispatcherServlet;
//
//import javax.servlet.ServletContext;
//import javax.servlet.ServletRegistration;
//
///**
// * @Description: MyWebApplicationInitializer：类描述
// * @author: songzhangyong
// * @Date: 2019/11/26 10:34
// */
//
//
//public class MyWebApplicationInitializer implements WebApplicationInitializer {
//
//	@Override
//	public void onStartup(ServletContext servletCxt) {
//
//		System.out.println("-----MyWebApplicationInitializer-------onStartup---");
//
//		// Load Spring web application configuration
//		AnnotationConfigWebApplicationContext ac = new AnnotationConfigWebApplicationContext();
//		ac.register(MvcAppConfig.class);
//		ac.refresh();
//
//		// Create and register the DispatcherServlet
//		DispatcherServlet servlet = new DispatcherServlet(ac);
//		ServletRegistration.Dynamic registration = servletCxt.addServlet("mvc", servlet);
//		registration.setLoadOnStartup(1);
//		registration.addMapping("/mvc/*");
//	}
//}
